<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <title>02.View</title>
  <link rel="stylesheet" href="../_assets/theme.css">
</head>
<body>
  <!-- Layout will be inserted here. -->
  <div class="main"></div>

  <!-- Layout template. -->
  <script class="template" type="template" id="layout">
    <h1>Hello world!</h1>
    <p></p>
  </script>

  <!-- View template -->
  <script class="template" type="template" id="view">
    This is some content...
  </script>

  <!-- Dependencies. -->
  <script src="../../bower_components/jquery/dist/jquery.js"></script>
  <script src="../../bower_components/underscore/underscore.js"></script>
  <script src="../../bower_components/backbone/backbone.js"></script>

  <!-- LayoutManager library. -->
  <script src="../../backbone.layoutmanager.js"></script>

  <!-- Example code. -->
  <script contenteditable="true">
    // Create a View to be used with the Layout below.
    var View = Backbone.Layout.extend({
      template: "#view"
    });

    // Create a new Layout.
    var layout = new Backbone.Layout({
      // Attach the Layout to the main container.
      el: ".main",

      // Use the previous defined template.
      template: "#layout",

      // Declaratively bind a nested View to the Layout.
      views: {
        "p": new View()
      }
    });

    // Render the Layout.
    layout.render();
  </script>

  <h3><a href="03.Events.html">Next example: Adding events.</a></h3>
</body>
</html>
